home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / overview / dtscpluslibrary / sources / spincursortest.cp < prev    next >
Encoding:
Text File  |  2000-06-23  |  2.0 KB  |  71 lines

  1. /*
  2.     File:        SpinCursorTest.cp
  3.  
  4.     Contains:    TSpinCursor is a simple cursor spinning class.
  5.                   SpinCursorTest.cp contains the TSpinCursor test functions.
  6.  
  7.     Written by: Kent Sandvik    
  8.  
  9.     Copyright:    Copyright © 1992-1999 by Apple Computer, Inc., All Rights Reserved.
  10.  
  11.                 You may incorporate this Apple sample source code into your program(s) without
  12.                 restriction. This Apple sample source code has been provided "AS IS" and the
  13.                 responsibility for its operation is yours. You are not permitted to redistribute
  14.                 this Apple sample source code as "Apple sample source code" after having made
  15.                 changes. If you're going to re-distribute the source, we require that you make
  16.                 it clear in the source that the code was descended from Apple sample source
  17.                 code, but that you've made changes.
  18.  
  19.     Change History (most recent first):
  20.                 8/18/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  21.                 
  22.  
  23. */
  24. #include "SpinCursor.h"
  25.  
  26. // This program will sping 20 times forwards and 20 time backwards.
  27. // Don't forget to include the SpinCursor.r resources when you test
  28. // the program.
  29.  
  30. const long kSpins = 20;                            // # spins
  31. const short kWatchID = 6500;                    // acur resource ID
  32. const short kDelayTime = 20;                    // delay between spins
  33.  
  34. void main(void)
  35. {
  36.     cout << "Start of TSpinCursor test…\n";
  37.  
  38.     //    Create TSpinCursor object.
  39.     TSpinCursor mySpin(kWatchID);
  40.  
  41.     //    Spin forwards.
  42.     cout << "First forwards…\n";
  43.     for (long ticking = 0; ticking < kSpins; ticking++)
  44.     {
  45.         ::Delay(kDelayTime, NULL);
  46.         mySpin.Spin();
  47.     }
  48.  
  49.     // Change directions.
  50.     mySpin.SetSpinDirection(TSpinCursor::kBackwards);
  51.  
  52.     //    Spin backwards.
  53.     cout << "Then backwards…\n";
  54.     for (int ticking = 0; ticking < kSpins; ticking++)
  55.     {
  56.         ::Delay(kDelayTime, NULL);
  57.         mySpin.Spin();
  58.     }
  59.  
  60.     cout << "End of the TSpinCursor test!\n";
  61. }
  62.  
  63. // _________________________________________________________________________________________________________ //
  64.  
  65.  
  66. /*    Change History (most recent last):
  67.   No        Init.    Date        Comment
  68.   1            khs        12/14/92    New file
  69.   2            khs        1/3/93        Cleanup
  70. */
  71.